<template>
	<view class="bgff pd">
		<view class="btm pt20 pm20  display-flex" @tap="hf('messageList?title=通知&type=1')">
			<view class=" vertical-center dfdvtrt">
				<icon class="iconfont icon-gonggao z9 fz50"></icon>
			</view>
			<view class=" flex-1 ml10">
				
				<view class="fz32 display-flex">
					<view class="flex-1">
						公告
					</view>
					<view class="z9 fz24">
						{{pub.noticeTime}}
					</view>
				</view>
				<view class="fz24 z9 mt10">
				{{pub.msg||'暂无新消息'}}	
				</view>
			</view>
			<view class="vertical-center">
				<icon class="iconfont icon-rightyou z9 fz32"></icon>
			</view>
		</view>
		<view class="btm pt20 pm20  display-flex" @tap="hf('messageList?title=通知&type=2')">
			<view class=" vertical-center dfdvtrt">
				<icon class="iconfont icon-tongzhi z9 fz50"></icon>
			</view>
			<view class=" flex-1 ml10">
				<view class="fz32 display-flex">
					<view class="flex-1">
						通知
					</view>
					<view class="z9 fz24">
						{{notice.noticeTime}}
					</view>
				</view>
				<view class="fz24 z9 mt10">
					{{notice.msg||'暂无新消息'}}
				</view>
			</view>
			<view class="vertical-center">
				<icon class="iconfont icon-rightyou z9 fz32"></icon>
			</view>
		</view>
		<view class="btm pt20 pm20  display-flex" @tap="hf('messageList?title=工作消息&type=3')">
			<view class=" vertical-center dfdvtrt">
				<icon class="iconfont icon-ziyuangongzuoxiaoxi z9 fz36"></icon>
			</view>
			<view class=" flex-1 ml10">
			
				<view class="fz32 display-flex">
					<view class="flex-1">
						工作消息
					</view>
					<view class="z9 fz24">
						{{job.noticeTime}}
					</view>
				</view>
				<view class="fz24 z9 mt10">
					{{job.msg||'暂无新消息'}}
				</view>
			</view>
			<view class="vertical-center">
				<icon class="iconfont icon-rightyou z9 fz32"></icon>
			</view>
		</view>
		<view class="btm pt20 pm20  display-flex" @tap="hf('messageList?title=系统消息&type=4')">
			<view class=" vertical-center dfdvtrt">
				<icon class="iconfont icon-xitongxiaoxi z9 fz50"></icon>
			</view>
			<view class=" flex-1 ml10">
				<view class="fz32 display-flex">
					<view class="flex-1">
						系统消息
					</view>
					<view class="z9 fz24">
						{{sys.noticeTime}}
					</view>
				</view>
				<view class="fz24 z9 mt10">
					{{sys.msg||'暂无新消息'}}
				</view>
			</view>
			<view class="vertical-center">
				<icon class="iconfont icon-rightyou z9 fz32"></icon>
			</view>
		</view>

	</view>
</template>
<script lang="ts" setup>
	import { onShow, } from "@dcloudio/uni-app"
	import { ref } from "vue"
	import { hf, caifen, VerifyTheLogin, dxrequest } from "@/util/index.js"
	const userId = uni.getStorageSync("userId")
	const pub = ref({})
	const notice = ref({})
	const job = ref({})
	const sys = ref({})
	const initdata = async () => {
		const { data } = await dxrequest("/api/notice/getListFirst/" + userId)
		console.log(data)
		if(data.pub[0]){
			pub.value = data.pub[0]
		}
		if(data.notice[0]){
			notice.value = data.notice[0]
		}
		
		if( data.job[0]){
			job.value = data.job[0]
		}
		if(data.sys[0]){
					sys.value = data.sys[0]
		}

		
	}

	onShow(() => {
		initdata()
		VerifyTheLogin()
	})
</script>

<style scoped>
	.dfdvtrt {
		width: 80rpx;
	}
</style>